import axios from 'axios'
import { baseURL } from './api'

export async function verifyToken() {
  try {
    const token = localStorage.getItem('token')
    if (!token) {
      return false
    }

    const response = await axios({
      method: 'post',
      url: baseURL + '/user-service/user/verifytoken',
      params: {
        token: token
      }
    })

    return response.data.result === 'success'
  } catch (error) {
    console.error('Token验证失败:', error)
    return false
  }
} 